public class Test{
    public static void main(String[] args) {
        MyBinaryTree myBinaryTree = new MyBinaryTree();//实例化
        MyBinaryTree.Node tree = myBinaryTree.createBinaryTree();//创建一棵二叉树
        System.out.println("前序遍历：");
        myBinaryTree.preOrder(tree);//前序遍历
        System.out.println();
        System.out.println("中序遍历：");
        myBinaryTree.inOrder(tree);//中序遍历
        System.out.println();
        System.out.println("后序遍历：");
        myBinaryTree.postOrder(tree);//后序遍历
        System.out.println();
        System.out.println("二叉树节点个数：");
        int size1 = myBinaryTree.size(tree);
        System.out.println(size1);//二叉树节点个数
        System.out.println("二叉树的叶子节点:");
        int size2 = myBinaryTree.getLeafNodeCount(tree);//二叉树的叶子节点个数
        System.out.println(size2);
        System.out.println("第k层的节点个数：");
        int size3 = myBinaryTree.getKLevelNodeCount(tree,2);
        System.out.println(size3);
        System.out.println("树的高度：");
        int size4 = myBinaryTree.getHeight(tree);
        System.out.println(size4);
        System.out.println("判断一个节点是否存在：");
        MyBinaryTree.Node node = myBinaryTree.find(tree,2);
        if (node != null)
        {
            System.out.println(node);
        } else {
            System.out.println(false);
        }
        System.out.println("层序遍历：");
        myBinaryTree.levelOrder(tree);
        System.out.println("判断二叉树是否是完全二叉树：");
        System.out.println(myBinaryTree.isCompleteTree(tree));
    }
}